// *********Admin端路由*************
// Containers
import Full from '@/containers/admin/Full'
// login
import Login from '@/views/admin/Login'
// Dashboard
import Dashboard from '@/views/admin/Dashboard'
// User index
import UserIndex from '@/views/admin/user/Index'
// authGroup index add edit
import AuthGroupIndex from '@/views/admin/AuthGroup/Index'
import AuthGroupAdd from '@/views/admin/AuthGroup/Add'
import AuthGroupEdit from '@/views/admin/AuthGroup/Edit'
// authRule index add edit
import AuthRuleIndex from '@/views/admin/AuthRule/Index'
import AuthRuleAdd from '@/views/admin/AuthRule/Add'
import AuthRuleEdit from '@/views/admin/AuthRule/Edit'
// Menu index add edit
import MenuIndex from '@/views/admin/Menu/Index'

export default [
  // admin 登录
  {
    path: '/admin/login',
    name: 'Login',
    component: Login
  },
  // admin 后台
  {
    path: '/admin',
    name: 'Admin',
    component: Full,
    redirect: '/admin/dashboard/index',
    meta: {
      title: '首页',
      requireAuth: true
    },
    children: [
      {
        path: 'dashboard/index',
        name: 'AdminDashboard',
        component: Dashboard,
        meta: {
          title: '仪表板',
          requireAuth: true
        }
      },
      {
        path: 'authGroup',
        redirect: '/admin/authGroup/index',
        name: 'authGroup',
        component: {
          render (c) { return c('router-view') }
        },
        meta: {
          title: '分组权限',
          requireAuth: true
        },
        children: [
          {
            path: 'index',
            name: 'authGroupIndex',
            component: AuthGroupIndex,
            meta: {
              title: '分组列表',
              requireAuth: true
            }
          },
          {
            path: 'add',
            name: 'authGroupAdd',
            component: AuthGroupAdd,
            meta: {
              title: '添加分组',
              requireAuth: true
            }
          },
          {
            path: 'edit/:id',
            name: 'authGroupEdit',
            component: AuthGroupEdit,
            meta: {
              title: '修改分组',
              requireAuth: true
            }
          }
        ]
      },
      {
        path: 'authRule',
        redirect: '/admin/authRule/index',
        name: 'authRule',
        component: {
          render (c) { return c('router-view') }
        },
        meta: {
          title: '权限规则',
          requireAuth: true
        },
        children: [
          {
            path: 'index',
            name: 'authRuleIndex',
            component: AuthRuleIndex,
            meta: {
              title: '规则列表',
              requireAuth: true
            }
          },
          {
            path: 'add',
            name: 'authRuleAdd',
            component: AuthRuleAdd,
            meta: {
              title: '添加规则',
              requireAuth: true
            }
          },
          {
            path: 'edit/:id',
            name: 'authRuleEdit',
            component: AuthRuleEdit,
            meta: {
              title: '修改规则',
              requireAuth: true
            }
          }
        ]
      },
      {
        path: 'Menu',
        redirect: '/admin/menu/index',
        name: 'Menu',
        component: {
          render (c) { return c('router-view') }
        },
        meta: {
          title: '菜单管理',
          requireAuth: true
        },
        children: [
          {
            path: 'index',
            name: 'MenuIndex',
            component: MenuIndex,
            meta: {
              title: '菜单列表',
              requireAuth: true
            }
          }
        ]
      },
      {
        path: 'user',
        redirect: '/admin/user/index',
        name: 'user',
        component: {
          render (c) { return c('router-view') }
        },
        meta: {
          title: '用户管理',
          requireAuth: true
        },
        children: [
          {
            path: 'index',
            name: 'UserIndex',
            component: UserIndex,
            meta: {
              title: '用户列表',
              requireAuth: true
            }
          }
        ]
      }
    ]
  }
]
